home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-27 | 12.9 KB | 388 lines | [TEXT/R*ch] |
- NOTE:: USE THE FOLLOWING INFORMATION AT YOUR OWN RISK!!
- THIS IS NOT SUPPORTED BY DTS AND COULD (WILL PROBABLY) CHANGE IN THE FUTURE
-
- /*******************************************************************************
- * Configuration Format Notes
- *
- * Client Configurations
- *
- * OT/PPP and OT/Remote Access client configurations store the information
- * necessary to place outgoing remote access calls. Configurations in OT/PPP
- * Version 1.0 are stored in a file called "Remote Access Connections" in the
- * "Remote Access" sub-folder of the Preferences folder. The type and creator
- * of this file are defined below.
- *
- * A client configuration is a collection of resources of different types, all
- * with the same resource ID. Multiple configurations can be stored in the
- * config file, with the currently selected configuration specified by a
- * meta-configuration resource (type 'ccfg', kRASelectedConfigType). This
- * scheme produces configurations compatible with the human interface
- * infrastructure OT/PPP currently inherits from Open Transport 1.1 and 1.1.1.
- *
- * The client configuration resources are described below. Note that some of
- * the resources are optional, while others must be present for the
- * configuration to be valid.
- *
- *
- * In addition to the resources associated with specific configurations, the
- * config file may contain one or more "global" resource, such as the 'ccfg'
- * mentioned above. These resources are also described below.
- *
- ********************************************************************************/
-
-
- #define kRASelectedConfigID 1
- // The ID for the global 'ccfg' resource
-
- #define kRAConfigFirstID 128
- // The starting ID for configuration resources
-
- #define kRASelectedConfigType 'ccfg'
- // Contains: SInt16
- // Description: ID of current selected configuration.
- // Client: required, global
-
- #define kRAConfigNameType 'cnam'
- // Contains: SInt16, ignored.
- // Description: the resource name is the configuration's name.
- // Client: required, specific
-
- #define kRAConfigTypeUserMode 'usmd'
- // Contains: see below
- // Description: user mode info and admim password
- // Client: required, specific (but treated as global by PPP control panel)
-
- type kRAConfigTypeUserMode
- {
- unsigned longint; // version
- unsigned longint; // userMode
- pstring [255]; // adminPassword
- };
-
- #define kRAConfigTypeClientMisc 'cmsc'
- // Contains: see below
- // Description: miscellaneous config info
- // Client: required, specific
-
- type kRAConfigTypeClientMisc
- {
- unsigned longint; // version
- unsigned longint; // isAutoConnect
- };
-
- #define kRAConfigTypeConnect 'conn'
- // Contains: see below
- // Description: general connection information
- // Client: required, specific
-
- type kRAConfigTypeConnect
- {
- unsigned longint; // version
- unsigned longint; // type
- unsigned longint; // isGuest
- unsigned longint; // canInteract
- unsigned longint; // showStatus
- unsigned longint; // passwordSaved
- unsigned longint; // flashConnectedIcon
- unsigned longint; // issueConnectedReminders
- longint; // reminderMinutes
- unsigned longint; // connectManually
- unsigned longint; // allowModemDataCompression
- unsigned longint; // chatMode
- unsigned longint; // serialProtocolMode
- unsigned longint; // password *
- unsigned longint; // userName *
- unsigned longint; // addressLength
- unsigned longint; // address *
- pstring [64]; // chatScriptName
- unsigned longint; // chatScriptLength;
- unsigned longint; // chatScript *
- unsigned longint; // additional *
- unsigned longint; // useSecurityModule
- unsigned longint; // securitySignature
- unsigned longint; // securityDataLength
- unsigned longint; // securityData *
- };
-
- #define kRAConfigTypeUser 'cusr'
- // Contains: variable length Pascal string
- // Description: the user login name, for RAConnect "user" field
- // Client: required, specific
-
- type kRAConfigTypeUserMode
- {
- unsigned longint; // version
- unsigned longint; // userMode
- pstring [255]; // adminPassword
- };
-
- #define kRAConfigTypePassword 'pass'
- // Contains: fixed length Pascal string (256)
- // Description: encrypted password, for RAConnect "password" field
- // Client: optional (required if passwordSaved == true), specific
-
- #define kRAConfigTypeAddress 'cadr'
- // Contains: variable length string, no length byte
- // Description: string data for RAConnect "address" field,
- // length determined by RAConnect::addressLength
- // Client: optional (required if addressLength > 0), specific
-
- #define kRAConfigTypeChat 'ccha'
- // Contains: variable length string data, no length byte
- // Description: string data for chat (connect) script, in
- // RAConnect "chatScript" field, length determined
- // by RAConnect::chatScriptLength
- // Client: optional (required if chatScriptLength > 0), specific
-
- #define kRAConfigTypeDialing 'cdia'
- // Contains: see below
- // Description: dialing mode and redialing information
- // Client: required, specific
-
- type kRAConfigTypeDialing
- {
- unsigned longint; // version
- unsigned longint; // type
- unsigned longint; // additional *
- unsigned longint; // dialMode
- longint; // redialTries
- unsigned longint; // redialDelay
- unsigned longint; // addresses *
- };
-
- #define kRAConfigTypeExtAddress 'cead'
- // Contains: RAAddress
- // Description: address (phone number) info for RADialing::addresses
- // Client: optional (required if RADialing::dialMode ==
- // kRADialModeRetryAlternates), specific
-
- #define kRAConfigTypeLogOptions 'logo'
- // Contains: see below
- // Description: user log controls
- // Client: optional, specific
-
- type kRAConfigTypeLogOptions
- {
- unsigned longint; // version
- unsigned longint; // type
- unsigned longint; // additional
- unsigned longint; // logLevel
- fill long [4]; // reserved[4], for future use.
- };
-
- #define kRAConfigTypeClientLocks 'clks'
- // Contains: see below
- // Description: client configuration lock values
- // Client: required, specific
-
- type kRAConfigTypeClientLocks
- {
- unsigned longint; // version
- unsigned longint; // name
- unsigned longint; // password
- unsigned longint; // number
- unsigned longint; // errorCheck
- unsigned longint; // headerCompress
- unsigned longint; // termWindow
- unsigned longint; // reminder
- unsigned longint; // autoConn
- unsigned longint; // redial
- };
-
- #define kRAConfigTypeLCP 'lcp '
- // Contains: see below
- // Description: LCP parameters
- // Client: required, specific
-
- type kRAConfigTypeLCP
- {
- unsigned longint; // version
- fill long [2]; // reserved[2]
- cstring [kRAMaxProviderNameSize]; // lowerLayerName
- align long; // pad to 4-byte boundary
- unsigned longint; // maxConfig
- unsigned longint; // maxTerminate
- unsigned longint; // maxFailureLocal
- unsigned longint; // maxFailureRemote
- unsigned longint; // timerPeriod
- unsigned longint; // echoTriger
- unsigned longint; // echoTimeout
- unsigned longint; // echoRetries
- unsigned longint; // compressionType
- unsigned longint; // mruSize
- unsigned longint; // upperMRULimit
- unsigned longint; // lowerMRULimit
- unsigned longint; // txACCMap
- unsigned longint; // rcACCMap
- };
-
- #define kRAConfigTypeIPCP 'ipcp'
- // Contains: see below
- // Description: IPCP parameters
- // Client: required, specific
-
- type kRAConfigTypeIPCP
- {
- unsigned longint; // version
- fill long [2]; // reserved[2]
- unsigned longint; // maxConfig
- unsigned longint; // maxTerminate
- unsigned longint; // maxFailureLocal
- unsigned longint; // maxFailureRemote
- unsigned longint; // timerPeriod
- unsigned longint; // localIPAddress
- unsigned longint; // remoteIPAddress
- unsigned longint; // allowAddressNegotiation
- unsigned longint; // compressTCPHeaders
- unsigned longint; // idleTimerMilliseconds
- };
-
- #define kRAConfigTypeTerm 'term'
- // Contains: see below
- // Description: terminal window parameters
- // Client: optional, global
-
- //
- // Kind of characters that are drawn in the terminal
- //
-
- typedef enum
- {
- kTTYKindTyped = 0, // character typed on the keyboard and sent to the server
- kTTYKindPrompted, // unrequested character
- kTTYKindEchoed, // local echo character
- kTTYMaxKindOfChar, // limit for RAConfigTTY array
- kTTYKindInitial = -1 // Initial invalid value
- } TTYKindOfChar;
-
- typedef struct
- {
- long fVersion;
- Boolean fLocalEcho;
- Boolean fNonModal;
- Boolean fPowerUser;
- Boolean fQuitWhenPPPStarts;
- Boolean fDontAskVarStr;
- Boolean fNoVarStrReplace;
- Boolean fLFAfterCR;
- Boolean fAskToSaveOnQuit;
- Rect fWindowRect;
- Style fCharKindStyle[kTTYMaxKindOfChar + kTTYMaxKindOfChar % 2]; // 2 byte aligned
- short fFontSize;
- Str255 fFontName;
- } RAConfigTTY;
-
-
- /*******************************************************************************
- * kRAConfigFormatVersion
- *
- * Match the version in each resource read from the file with this
- * constant to see if the code and the configurations file are compatible.
- * High word represents major version, low word represents minor.
- ********************************************************************************/
-
- #define kRAConfigFormatVersion 0x00010000
-
-
- /*******************************************************************************
- * Miscellaneous constants used for configuration resources
- ********************************************************************************/
-
- #define kRADefaultRedialTries 1 // default number of times to redial
- #define kRADefaultRedialDelaySec 5 // default seconds between dial attempts
-
- #define kRAConfigNoviceUser 1 // NOTE must be kept in sync with
- #define kRAConfigExpertUser 2 // values used by Peppermint framework
- #define kRAConfigAdminUser 3 // See CControlPanel.h (not rez-able)
-
-
- /*******************************************************************************
- * Info on the ARA/PPP username and password.
- *
- * The ARA/PPP password is stored using DES encryption with the
- * username as the key. There are many publically available
- * implementation of DES. You will need to find a DES
- * implementation (don't pay the bug bucks, just hunt around
- * the net, there are many to be found) A good starting place
- * is the crypto FTP archives at
- * <http://www.cs.hut.fi/crypto/>
- *
- * Only the first 8 characters of the user name affect the
- * 'pass' resource. If the user name is greater than 8
- * character it does not matter what the characters are, they
- * have no effect. The password, however, appears to have the
- * capability of using all 255 characters although I did not
- * actually test this.
- *
- * The 'pass' resource is created as follows. First the user
- * name is truncated to 8 characters. Then the user name and
- * password are padded with zeros to be a fixed size buffer.
- * The user name is 8 bytes zero padded and the password is 255
- * bytes zero padded. The 8 byte user name is used as a key
- * but shifted one bit and munged as you described. The 'pass'
- * resource we create will be 256 bytes long. The first byte
- * is always zero.
- *
- * Use the DES library to encrypt 8 bytes at a time and then
- * append the encrypted bytes to the resource. The resource
- * starts as off as one zeroed out byte. Each pass through the
- * loop encrypts another 8 bytes using the same munged user
- * name for the key and the next 8 characters of the password
- * as the data until all 255 characters of the password are
- * used.
- *
- * Since the first byte of the resource is the "always zero"
- * byte that adds up to 256.
- *
- *
- * If I were using the RSA version, I would build an EncryptPassword
- * routine to look like:
- *
- *
- * void EncryptPassword( // encrypt a password using the user name as key
- * char *pUserName, // the user name
- * char *pPasswordIn, // the password
- * char *rPasswordOut) // returns the encrypted password
- * {
- * // assumes null terminated strings for user name, and password in
- * // the password out buffer must be the (((password in buffer + 7) / 8) * 8)
- * // where the password in length includes the null termination char
- *
- * char vKey[8];
- * DES_CTX vDESContext;
- *
- * struct{
- * unsigned long hi;
- * unsigned long lo;
- * } shiftedKey;
- *
- * // copy the password from the input to the output buffer (null padded)
- * memset(rPasswordOut, 0, ((strlen(pPasswordIn) + 8) / 8) * 8);
- * strcpy(rPasswordOut, pPasswordIn);
- *
- * // make the key (null padded)
- *
- * memset(vKey, 0, 8);
- * strncpy(vKey, pUserName, 8);
- *
- * //each 32 bits word of the key must be shifted left by 1 bit before calling DESEncryptInit.
- * memcpy(&shiftedKey, vKey, 8);
- * shiftedKey.hi =shiftedKey.hi << 1;
- * shiftedKey.lo =shiftedKey.lo << 1;
- * memcpy(vKey, &shiftedKey, 8);
- *
- * // initialize DES encryption
- * memset(&vDESContext, 0, sizeof(vDESContext));
- * DESEncryptInit(&vDESContext, (unsigned char*) vKey);
- *
- * // encrypt the password
- *
- * DES( (POINTER) &vDESContext,
- * (unsigned char*) rPasswordOut,
- * (unsigned char*) rPasswordOut);
- *
- * return;
- * }
- *
- ********************************************************************************/
-